cmake_minimum_required(VERSION 3.13)
project(live2d2)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CPP_FILES 
    main.cpp 
    view/mainwindow.cpp
    view/liblive2d/Live2D.cpp
    view/liblive2d/Config.cpp
    view/liblive2d/HtmlBuilder.cpp
    view/liblive2d/scpdialog.h view/liblive2d/scpdialog.cpp
    )

set(HEADER_FILES
    view/mainwindow.h
    view/liblive2d/Live2D.h
    view/liblive2d/Config.h
    view/liblive2d/HtmlBuilder.h
    view/liblive2d/scpdialog.h view/liblive2d/scpdialog.h
    )

find_package(Qt5 COMPONENTS Widgets WebEngineWidgets REQUIRED)

file(COPY html DESTINATION ${CMAKE_BINARY_DIR})
file(COPY config DESTINATION ${CMAKE_BINARY_DIR})

qt5_add_resources(QRC_FILES resource/resource.qrc)

add_executable(live2d2 ${QRC_FILES} ${HEADER_FILES} ${CPP_FILES})

target_link_libraries(live2d2 PRIVATE Qt5::Widgets Qt5::WebEngineWidgets)
